package com.ply.flashsalessystem.entity.status;

import com.ply.flashsalessystem.entity.vo.OrderForGoodsDetaileVo;
import com.ply.flashsalessystem.entity.vo.store.OrderForStoreVo;

import java.util.List;
import java.util.Objects;

/**
 * @author XiaoPan
 * date: 2022/4/1 18:12
 * <p>
 * action:
 */
public interface OrderDetailsStatus {
    /**
     * 未分拣
     */
    Integer No_Pickup = 0;

    /**
     * 分拣成功
     */
    Integer Do_Pickup = 1;

    /**
     * 退货申请
     */
    Integer RETURN_APPLY = 2;

    /**
     * 退货成功
     */
    Integer RETURN_SUCCESS = 3;

    /**
     * 退货失败
     */
    Integer RETURN_ERROR = 4;

    /**
     * 订单异常
     */
    Integer ORDER_ERROR = 6;

    static List<OrderForGoodsDetaileVo> addStatusString(List<OrderForGoodsDetaileVo> order) {
        if (order == null){
            return null;
        }
        for (OrderForGoodsDetaileVo orderForStoreVo : order) {
            Integer status = orderForStoreVo.getStatus();
            if (Objects.equals(status, No_Pickup)) {
                orderForStoreVo.setOrderDetailsStatusString("未分拣");
                continue;
            }
            if (Objects.equals(status, Do_Pickup)) {
                orderForStoreVo.setOrderDetailsStatusString("分拣成功");
            }
        }
        return order;
    }
}
